package com.difsonapps.contacttranslator.utils;

import java.util.List;

import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;




@XmlRootElement(name = "messages")
public class FCRootMessage {

	List<FCMessage> messages;

	
	public List<FCMessage> getMessages() {
		return messages;
	}

	@XmlElement(name = "message")
	public void setMessages(List<FCMessage> messages) {
		this.messages = messages;
	}
	
	
	public FCMessage find(String appli, String lang,String type)
	{
		if(messages==null || messages.size()<=0)
			return null;
		
		for (FCMessage fcMessage : messages) {
			if(fcMessage.getAppli().equals(appli) && fcMessage.getLang().equals(lang) && fcMessage.getType().equals(type))
				return fcMessage;
		}
		return null;
	}
}
